#!/bin/bash -e

function info() {
echo Usage: `basename $0` 'g.vcf.list'
exit 1
}

while getopts  ":p:f:i:" opt; do
	case  $opt  in
		p) out_prefix=$OPTARG;;
		f) suffix=$OPTARG;;
        i) bed=$OPTARG;;
		*) info;;
	esac
done
shift $(($OPTIND - 1))


if [ $# -lt 1 ]; then info; fi

. $var

# bam=$1
# bed=$2
list=$1

# CombineGVCFs # run CombineGVCFs on batches of ~200 gVCFs to hierarchically merge them into a single gVCF

echo; echo CombineGVCFs
$java_run/gatk37 \
    -R $ref_genome \
    -T CombineGVCFs \
    --variant $list \
    -o $out_prefix.combine.g.vcf


. $cmd_done



echo; echo GenotypeGVCFs
java $j_mem -jar $gatk \
    -R $ref_genome \
    -T GenotypeGVCFs \
    --variant sample1.g.vcf \
    -o $out_prefix.vcf